home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
55671
/
55671.xpi
/
chrome
/
snipit.jar
/
content
/
snipit.js
< prev
next >
Wrap
Text File
|
2008-04-18
|
2KB
|
65 lines
window.addEventListener("load", snipit_initialize, false);
function showHideSnipIt()
{
const prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
if (prefs.prefHasUserValue("snipit.contextmenuitem"))
{
var element = document.getElementById("snipit-menu");
if (element)
{
element.setAttribute("hidden", !prefs.getBoolPref("snipit.contextmenuitem"));
}
}
}
function snipit()
{
const prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
var host = "http://www.snip.pl";
var url = null;
var win = null;
var openpref = null;
if (prefs.prefHasUserValue("snipit.ssl"))
if (prefs.getBoolPref("snipit.ssl") == true)
host = "https://ssl.snip.pl";
url = host + "/snip-it.php?ref=" + escape(getBrowser().currentURI.spec);
if (prefs.prefHasUserValue("snipit.openpagein"))
{
openpref = prefs.getComplexValue("snipit.openpagein", Components.interfaces.nsISupportsString).data;
if (openpref.indexOf("self") > -1)
{
getBrowser().loadURI(url, null, null);
}
else if (openpref.indexOf("window") > -1)
{
win = window.open(url, 'SnipIt', 'dependent=no,location=yes,menubar=yes,status=yes,resizable=yes,scrollbars=yes,toolbar=yes');
win.focus();
}
else
{
win = getBrowser().addTab(url);
getBrowser().selectedTab = win;
}
}
else
{
win = getBrowser().addTab(url);
getBrowser().selectedTab = win;
}
}
function snipit_initialize(event)
{
try
{
showHideSnipIt();
window.removeEventListener("load", snipit_initialize, false);
}
catch(exception)
{
}
}